#include "PowerManager.h"

/* CONSTRUCTOR */
PowerManager::PowerManager()
{
  m_forwardPwmPort = 13;
  m_backwardPwmPort = 13;
  pinMode(m_forwardPwmPort, OUTPUT);
  digitalWrite(m_forwardPwmPort, HIGH);
  //analogWrite(m_forwardPwmPort, 100);
}

/* METHODES */

/**
* \brief Set the forward motor speed
* \param speedValue
* \return none
*/
void PowerManager::moveForward(byte speedValue)
{
  analogWrite(m_backwardPwmPort, 0);
  analogWrite(m_forwardPwmPort, speedValue);
}

/**
* \brief Set the backward motor speed
* \param speedValue
* \return none
*/
void PowerManager::moveBackward(byte speedValue)
{
  analogWrite(m_forwardPwmPort, 0);
  analogWrite(m_backwardPwmPort, speedValue);
}

/**
* \brief Stop the motor
* \param none
* \return none
*/
void PowerManager::stop()
{
  analogWrite(m_forwardPwmPort, 0);
  analogWrite(m_backwardPwmPort, 0);
}


